]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
sessionMode: Add showCalendarEvents property
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 17 May 2012 22:32:04 +0000 (00:32 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 22 May 2012 17:42:28 +0000 (19:42 +0200)
Add a sessionMode.showCalendarEvents property, which determines
whether the calendar menu should contain an events section or not.

https://bugzilla.gnome.org/show_bug.cgi?id=676156

js/ui/dateMenu.js
js/ui/panel.js
js/ui/sessionMode.js

index 616e45afe19f7ec22fdaaa6249c0f6b431b24ff3..656ac0e1fa7e3ab6018779709d018e837ccfc03b 100644 (file)
@@ -45,9 +45,7 @@ const DateMenuButton = new Lang.Class({
     Name: 'DateMenuButton',
     Extends: PanelMenu.Button,
 
-    _init: function(params) {
-        params = Params.parse(params, { showEvents: true });
-
+    _init: function() {
         let item;
         let hbox;
         let vbox;
@@ -79,7 +77,7 @@ const DateMenuButton = new Lang.Class({
         this._date.style_class = 'datemenu-date-label';
         vbox.add(this._date);
 
-        if (params.showEvents) {
+        if (Main.sessionMode.showCalendarEvents) {
             this._eventSource = new Calendar.DBusEventSource();
             this._eventList = new Calendar.EventsList(this._eventSource);
         } else {
@@ -110,7 +108,7 @@ const DateMenuButton = new Lang.Class({
             item.actor.reparent(vbox);
         }
 
-        if (params.showEvents) {
+        if (Main.sessionMode.showCalendarEvents) {
             // Add vertical separator
 
             item = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
index eb3a9e793e43311af5987aaa4502930049a28096..d712b9e0a981ea881dc7808f772c540681b4a5b2 100644 (file)
@@ -978,10 +978,7 @@ const Panel = new Lang.Class({
         }
 
         /* center */
-        if (Main.sessionMode.sessionType == Shell.SessionType.USER)
-            this._dateMenu = new DateMenu.DateMenuButton({ showEvents: true });
-        else
-            this._dateMenu = new DateMenu.DateMenuButton({ showEvents: false });
+        this._dateMenu = new DateMenu.DateMenuButton();
         this._centerBox.add(this._dateMenu.actor, { y_fill: true });
         this._menus.addMenu(this._dateMenu.menu);
 
index 3e05400b9f05afe3f837004b120cc6b60d55a180..df25923135bac86da0dd3261c48cb550350cfefd 100644 (file)
@@ -10,10 +10,12 @@ const DEFAULT_MODE = 'user';
 const _modes = {
     'gdm': { hasOverview: false,
              hasAppMenu: false,
+             showCalendarEvents: false,
              sessionType: Shell.SessionType.GDM },
 
     'user': { hasOverview: true,
               hasAppMenu: true,
+              showCalendarEvents: true,
               sessionType: Shell.SessionType.USER }
 };